<?php
/* @var $this PrescriptionheaderController */
/* @var $model Prescriptionheader */

$this->breadcrumbs=array(
	'Prescriptionheaders'=>array('index'),
	$model->id,
);
if ((Yii::app()->user->type==="Admin")) {
$this->menu=array(
	array('label'=>'List Order', 'url'=>array('index')),
	array('label'=>'Create Order', 'url'=>array('create')),
	array('label'=>'Update Order', 'url'=>array('update', 'id'=>$model->id)),
	array('label'=>'Delete Order', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	array('label'=>'Manage Order', 'url'=>array('admin')),
);
}else if((Yii::app()->user->type==="Pharmacist")){
$this->menu=array(
        array('label'=>'Manage', 'url'=>array('admin')),
        array('label'=>'List', 'url'=>array('index')),
        array('label'=>'Update', 'url'=>array('update', 'id'=>$model->id)),
        array('label'=>'Create', 'url'=>array('create')),
        );
		}
?>
<?php
$this->breadcrumbs=array(
	'Prescriptiondetails','Prescriptionheader'=>array('index'),
	$model->id,
);

$this->menu=array(
array('label'=>'Add Prescriptiondetail', 'url'=>array('prescriptiondetail/create','prescriptionheader_id'=>$model->id)),
	//array('label'=>'List Prescriptiondetail', 'url'=>array('index')),
	//array('label'=>'Create Prescriptiondetail', 'url'=>array('create')),
	//array('label'=>'Update Prescriptiondetail', 'url'=>array('update', 'id'=>$model->id)),
	//array('label'=>'Update Prescriptionheader', 'url'=>array('update', 'id'=>$model->id)),
	//array('label'=>'Delete Prescriptiondetail', 'url'=>'#', 'linkOptions'=>array('submit'=>array('delete','id'=>$model->id),'confirm'=>'Are you sure you want to delete this item?')),
	//array('label'=>'Manage Prescriptiondetail', 'url'=>array('admin')),
);
?>

<h1>View Prescriptionheader #<?php echo $model->id; ?></h1>

<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$model,
	'attributes'=>array(
		'id',
		'date',
		'patient.patient_lastname',
		'employee.emp_lastname',
	),
)); ?>


<?php $pres = Prescriptiondetail::model()->findAll('prescriptionheader_id= :a', array(':a'=>$model->id));
 if (count($pres) !== 0){
$presno = 0;
?>


<h2>PrescriptionDetail  <?php echo $model->id; ?></h2>
<?php foreach ($pres as $row) { ?>
<?php $this->widget('zii.widgets.CDetailView', array(
	'data'=>$row,
	'attributes'=>array(
		//'id',
		//'prescriptionheader_id',
		//'product_id',
		'presmedicine_qty',
		'pres_medicine_ins',
	),
));
echo "<br>";
}


 
}?>

